import config from '../config.js'
import request from './request.js'

export const getRedisList = async  () => {
	let list = await request({
		url: config.server + '/list',
		method: 'post',
		encryption:false,
		data: {}
	})
	return list.list
}


export const getRedisValue = async  (key) => {
	let list = await request({
		url: config.server + '/get',
		method: 'post',
		encryption:false,
		data: {"key":key}
	})
	return list.result
}


export const saveRedis = async  (keyName,keyValue, second = '') => {
	let list = await request({
		url: config.server + '/set',
		method: 'post',
		encryption:false,
		data: {"key":keyName, "value":keyValue, "second":second}
	})
	return list.result
}


export const delRedis = async  (keyName) => {
	let list = await request({
		url: config.server + '/del',
		method: 'post',
		encryption:false,
		data: {"key":keyName}
	})
	return list.result
}

